
<template>
  <div>组件自定义v-model

  <div>
    
    {{ value1 }}

    <div>
      {{ id }}
    </div>

    <button @click="update">修改</button>
  </div>

    <div>
        ----------------
    </div>
  
    <VModelCom v-model:id="id" v-model="value1"></VModelCom>

  </div>
</template>

<script lang='ts' setup>
import { reactive,toRefs,ref,onMounted} from 'vue'
import VModelCom from './VModelCom.vue';

const value1=ref('hello');
const id=ref(0);

const update=()=>{
    value1.value='hello world';

    id.value=1;
}


</script>
<style scoped>
</style>